package com.poorstu.web.auditaction;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;

import com.common.base.web.BaseAction;
import com.poorstu.manager.StudentManager;
import com.poorstu.model.UserPartTimeMod;

public class PartTimeApplyAuditAction extends BaseAction {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
				try{
		DynaActionForm dyna=(DynaActionForm)form;
		int userPartTimeId=(Integer)dyna.get("userPartTimeId");
		int status=(Integer)dyna.get("auditStatus");
		String remark=(String)dyna.get("auditRemark");
		UserPartTimeMod uptm=new UserPartTimeMod();
		uptm.setComments(remark);
		uptm.setParStatus(status);
		StudentManager stu =(StudentManager)getBean("studentManager");
		
		stu.partTimeAppluAudit(uptm,userPartTimeId);
		
		return mapping.findForward("succ");
				}catch(Exception e){
					e.printStackTrace();
					
				}
		
				return mapping.findForward("failure");
	}
	
	

}
